"""hg_survey URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path, include
import survey.views as survey_view
import students.views as student_view
from rest_framework import routers
from django.contrib.auth.views import LoginView
from django.views.generic.base import TemplateView
from . import settings

router = routers.DefaultRouter()
router.register('surveys', survey_view.SurveyViewSet)
router.register('questions', survey_view.QuestionViewSet)
router.register('answers', survey_view.AnswerSetViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('load_info/', student_view.load_student_info, name="load_info"),
    path('accounts/', include('django.contrib.auth.urls')),
    path('auth/login/', auth_views.LoginView.as_view(), name="survey_login"),
    path('survey/', include('survey.urls')),
    path('api/', include(router.urls)),
    path('api/surveys/<str:pk>', survey_view.SurveyDetail.as_view()),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('survey/<str:pk>/page', survey_view.SurveyPage, name="survey_page")
]
